package org.mozhu.rpc.transport.payload;

import java.util.concurrent.atomic.AtomicLong;

public class JRequestPayload extends PayloadHolder {

    private static final AtomicLong atomicLong = new AtomicLong();

    // 用于映射 <id, request, response> 三元组
    private final long invokeId;

    public JRequestPayload() {
        this(next());
    }

    public JRequestPayload(long invokeId) {
        this.invokeId = invokeId;
    }

    private static long next() {
        return atomicLong.incrementAndGet();
    }

    public long invokeId() {
        return invokeId;
    }

}
